package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.ExtIotViceProductYk;
import com.econ.powercloud.ems.dal.mapper.ExtIotViceProductYkMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2022-05-23-17:05
 */
@Repository
public class ExtIotViceProductYkDAO extends ServiceImpl<ExtIotViceProductYkMapper, ExtIotViceProductYk> {

    public List<ExtIotViceProductYk> selectListByProductsAndVal4IsNotNull(List<String> productKeys){
        LambdaQueryWrapper<ExtIotViceProductYk> wrapper = Wrappers.lambdaQuery();
        wrapper.in(CollectionUtils.isNotEmpty(productKeys),ExtIotViceProductYk::getProductKey,productKeys);
        wrapper.isNotNull(ExtIotViceProductYk::getVal4);
        return this.baseMapper.selectList(wrapper);
    }
}
